package com.qf.controller;

import com.qf.pojo.respVo.BaseResp;
import com.qf.pojo.vo.entity.ChildParenting;
import com.qf.service.ChildParentingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName PaternityController
 * @Description TODO
 * @Author Nslsg
 * @Date 2022/11/4 15:56
 * @Version 1.0
 **/
@RestController
@RequestMapping("/paternity")
public class ChildParentingController {

    @Autowired
    ChildParentingService childParentingService;

    @RequestMapping("/findAll")
    public BaseResp findByType(){
        return childParentingService.findAll();
    }

    @RequestMapping("/findByType/{type}/{page}/{size}")
    public BaseResp findByType(@PathVariable("type") Integer type,@PathVariable("page") Integer page, @PathVariable("size") Integer size){
        return childParentingService.findByType(type,page,size);
    }

    @RequestMapping("/findByAllId/{allId}/{page}/{size}")
    public BaseResp findByAllId(@PathVariable("allId")Integer allId,@PathVariable("page")Integer page,@PathVariable("size")Integer size){
        return childParentingService.findByAllId(allId,page,size);
    }

    @RequestMapping("/findById/{id}")
    public BaseResp findById(@PathVariable("id")Integer id){
        return childParentingService.findById(id);
    }
}
